Make add_to_bridge() always leave the device up even when it bails out due to the...
authorAnil Madhavapeddy <anil@xensource.com>
Tue, 22 Aug 2006 13:59:16 +0000 (14:59 +0100)
committerAnil Madhavapeddy <anil@xensource.com>
Tue, 22 Aug 2006 13:59:16 +0000 (14:59 +0100)
This makes the script more idempotent if run twice (e.g. from hotplug and udev), since the second time the device will be taken down and not brought up again, leaving the host without networking.

Signed-off-by: Anil Madhavapeddy <anil@xensource.com>
tools/examples/xen-network-common.sh

index 37bdd7758699eb18b02c7ef435dd5004c09143eb..4c230a64028cb64c5a42ed690e6c12faa504fd45 100644 (file)
@@ -143,6 +143,7 @@ add_to_bridge () {
 
     # Don't add $dev to $bridge if it's already on a bridge.
     if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then
+       ip link set ${dev} up || true
        return
     fi
     brctl addif ${bridge} ${dev}